// import Vue from 'vue'
// import Vuex from 'vuex'
//
// Vue.use(Vuex)
//
// export default new Vuex.Store({
//   state: {
//     loginInfo: {}
//   },
//   mutations: {
//     setLoginInfo (state, data) {
//       state.loginInfo = data
//     }
//   },
//   actions: {},
//   modules: {}
// })
import Vue from 'vue'
import Vuex from 'vuex'
// import getters from './getters'
const path = require('path')

Vue.use(Vuex)

const files = require.context('./modules', true, /\.js$/)
const modules = {}
files.keys().forEach(key => {
  const name = path.basename(key, '.js')
  modules[name] = files(key).default || files(key)
})
const store = new Vuex.Store({
  modules
})
export default store
